#include "typedef.h"
#include "_2misc.h"

typedef struct SystemArgs
{
    address drv_init_begin;
    address drv_init_end;

} *SystemArgs;

static struct SystemArgs sys_arg;

void build_sys_arg()
{

    extern executable __sdrv_begin__;
    extern executable __sdrv_end__;
    sys_arg.drv_init_begin = &__sdrv_begin__;
    sys_arg.drv_init_end = &__sdrv_end__;
}

address get_drv_begin()
{
    return sys_arg.drv_init_begin;
}

address get_drv_end()
{
    return sys_arg.drv_init_end;
}

int system_state[CFG_CORE_NUM+1];

int get_system_state(int core)
{
    return system_state[core];
}

volatile word gSVCStack[CFG_CORE_NUM][1024]; 
volatile word gIRQStack[CFG_CORE_NUM][1024];  
volatile word gMONStack[CFG_CORE_NUM][1024]; 
volatile word gFIQStack[CFG_CORE_NUM][1024]; 
volatile word gABTStack[CFG_CORE_NUM][1024]; 
volatile word gUNDStack[CFG_CORE_NUM][1024]; 
volatile word gHYPStack[CFG_CORE_NUM][1024]; 
volatile word gSYSStack[CFG_CORE_NUM][1024]; 